#ifndef BINDING_GENERATOR_H
#define BINDING_GENERATOR_H

#include "../expressions/expressioncommon.h"

#include <QtCore/QHash>
#include <QtCore/QSet>

namespace core
{
class BasicTime;
}

namespace wfnet
{
class Arc;
class Binding;
class IBindingAlgorithm;
class Transition;

class BindingGenerator
{
public:
    static BindingGenerator* getInstance();
    static void destroy();

    void registerBindingAlgorithm(ExpressionType type,
        IBindingAlgorithm* algorithm);
    void unregisterBindingAlgorithm(ExpressionType type);

    bool bind(Binding& binding,
        const core::BasicTime& globalClock,
        core::BasicTime& proposedGlobalClock,
        const QSet<const Arc* >& inputArcs,
        const QSet<const Arc* >& outputArcs,
        const Transition* transition,
        QSet<const Arc* >& toBeCheckedArcs) const;

private:
    BindingGenerator();
    ~BindingGenerator();

private:
    QHash<ExpressionType, IBindingAlgorithm* > m_algorithms;
};

} // namespace wfnet

#endif
